<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title></title>
<link href="static/css/style.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="static/js/jquery-1.3.2.min.js"></script>
<script type="text/javascript" src="static/js/common.js"></script>
</head>
<body id="main_page">
		<div id="nav" style="display:none;">
		<dl>

		<dt>当前位置：</dt>
            		    <dd class="link">网址管理</dd><!--导航-->
            		    <dd class="link">分类列表</dd><!--导航-->
            		</dl>
		</div>

<script type="text/javascript">
	if ($.browser.msie) {
		document.execCommand("BackgroundImageCache", false, true);
	}
	var nav = document.getElementById("nav");
	var pnav = window.parent.document.getElementById("nav")
	pnav.innerHTML = nav.innerHTML;

</script>

<div class="wrap">
    <div class="container">

        <div id="main">
            
            <div class="con">
            	
                  <div class="table">
                  	<div class="th">
                    	<div class="form">
                        <div class="fl">
                           <input type="button" onclick="window.location='?c=class&a=add'" value="添加分类" />

                              &nbsp;&nbsp;&nbsp;&nbsp;
                        </div>
                        <div id="classSearch" class="fl ml5" style="_margin-top:-6px;">
                            <input type="text" id="tool_kw" autocomplete="off" onclick="(this.value == '快速搜索分类') ? this.value='' :''" onblur="(this.value == '') ? this.value='快速搜索分类' :''" onmouseover="this.select()" value="快速搜索分类" class="textinput gray9 w270 mt5" />
                        </div>
                        </div>
                    </div>
                    <form action='?c=class&a=index&type=&classid=' method='post'>
                    <table class="admin-tb" id="datatable">

                    <thead>
                        <tr>
                            <th width="41" class="text-center">选择</th>
                            <th width="200">排序</th>
                            <th >分类名称</th>
                            <th width="200">生成目录名称 / 外链地址</th>
                            <th  width="80">站点数量</th>

                            <th width="161">操作</th>
                        </tr>
					</thead>
                                        <tr sitenum='0' sub_sitenum="2279" classnum='20'  classid="1" childindex="1">
                    <td class="text-center"><input name="rmid[1]" type="checkbox" rel="del"  /></td>
                    <td><input name="order[]" type="text" id="order[]" class="textinput" tabindex="11" value="1" size="4" />
                   <input name="orderid[]" type="hidden" id="orderid[]" value="1" /></td>
                    <td rel="classname"><a href="javascript://">娱乐休闲</a></td>

                    <td><input name="path[1]" type="text" class="textinput" style="width: 200px;" id="path[1]" value="" /></td>
                    <td>2279</td>
                    <td>
                        [<a href="?c=class&a=edit&id=1&type=&classid=&path=">修改</a>] &nbsp;
                        [<a href="?c=class&a=edit&id=1&type=&classid=&path=&mkhtml=1">生成 HTML</a>]
                    </td>

                    </tr>
                                        <tr sitenum='0' sub_sitenum="3542" classnum='24'  classid="2" childindex="1">
                    <td class="text-center"><input name="rmid[2]" type="checkbox" rel="del"  /></td>
                    <td><input name="order[]" type="text" id="order[]" class="textinput" tabindex="11" value="2" size="4" />
                   <input name="orderid[]" type="hidden" id="orderid[]" value="2" /></td>
                    <td rel="classname"><a href="javascript://">生活服务</a></td>
                    <td><input name="path[2]" type="text" class="textinput" style="width: 200px;" id="path[2]" value="" /></td>
                    <td>3542</td>

                    <td>
                        [<a href="?c=class&a=edit&id=2&type=&classid=&path=">修改</a>] &nbsp;
                        [<a href="?c=class&a=edit&id=2&type=&classid=&path=&mkhtml=1">生成 HTML</a>]
                    </td>
                    </tr>
                                        <tr sitenum='0' sub_sitenum="1086" classnum='17'  classid="4" childindex="1">
                    <td class="text-center"><input name="rmid[4]" type="checkbox" rel="del"  /></td>

                    <td><input name="order[]" type="text" id="order[]" class="textinput" tabindex="11" value="3" size="4" />
                   <input name="orderid[]" type="hidden" id="orderid[]" value="4" /></td>
                    <td rel="classname"><a href="javascript://">电脑网络</a></td>
                    <td><input name="path[4]" type="text" class="textinput" style="width: 200px;" id="path[4]" value="" /></td>
                    <td>1086</td>
                    <td>
                        [<a href="?c=class&a=edit&id=4&type=&classid=&path=">修改</a>] &nbsp;

                        [<a href="?c=class&a=edit&id=4&type=&classid=&path=&mkhtml=1">生成 HTML</a>]
                    </td>
                    </tr>
                                        <tr sitenum='0' sub_sitenum="2144" classnum='15'  classid="3" childindex="1">
                    <td class="text-center"><input name="rmid[3]" type="checkbox" rel="del"  /></td>
                    <td><input name="order[]" type="text" id="order[]" class="textinput" tabindex="11" value="4" size="4" />
                   <input name="orderid[]" type="hidden" id="orderid[]" value="3" /></td>
                    <td rel="classname"><a href="javascript://">文化教育</a></td>

                    <td><input name="path[3]" type="text" class="textinput" style="width: 200px;" id="path[3]" value="" /></td>
                    <td>2144</td>
                    <td>
                        [<a href="?c=class&a=edit&id=3&type=&classid=&path=">修改</a>] &nbsp;
                        [<a href="?c=class&a=edit&id=3&type=&classid=&path=&mkhtml=1">生成 HTML</a>]
                    </td>

                    </tr>
                                        <tr sitenum='0' sub_sitenum="1949" classnum='12'  classid="2226" childindex="1">
                    <td class="text-center"><input name="rmid[2226]" type="checkbox" rel="del"  /></td>
                    <td><input name="order[]" type="text" id="order[]" class="textinput" tabindex="11" value="5" size="4" />
                   <input name="orderid[]" type="hidden" id="orderid[]" value="2226" /></td>
                    <td rel="classname"><a href="javascript://">其他类别</a></td>
                    <td><input name="path[2226]" type="text" class="textinput" style="width: 200px;" id="path[2226]" value="" /></td>
                    <td>1949</td>

                    <td>
                        [<a href="?c=class&a=edit&id=2226&type=&classid=&path=">修改</a>] &nbsp;
                        [<a href="?c=class&a=edit&id=2226&type=&classid=&path=&mkhtml=1">生成 HTML</a>]
                    </td>
                    </tr>
                                        
                    </table>
                    <div class="th">

                    	<div class="form">
                        <input type='hidden' name='commit' value='1' />
                        <input type='radio' name='action' value='del' />删除
                        <input type='radio' name='action' value='update' checked />其他更改
                        <input type="submit" value="保存" />&nbsp;
                        &nbsp;
                        </div>
                    </div>
                    </form>
                </div>

            </div><!--/ con-->            
        </div>    
    </div><!--/ container-->

</div><!--/ wrap-->
<script type="text/javascript" src="static/js/catgorymanager.js"></script>
<script type="text/javascript">
    CatgoryManager.AjaxUrl = "?c=class&a=ajax_get_list&id=";
	CatgoryManager.SetDisplayFun(function(data,parentNode,childIndex){
		var pexyText = "├-";
		for(var i = 0; i < childIndex; i++){
			pexyText = "&nbsp;&nbsp;&nbsp;&nbsp;" + pexyText;
		}
		childIndex = Number(childIndex) + 1;
		var html = "";
		for(var key in data){
			var item = data[key];
			html += '<tr sitenum="'+item["sitenum"]+'" classnum="'+item["sub_classnum"]+'" sub_sitenum="'+item["sub_sitenum"]+'" classid="'+item["classid"]+'" childindex="'+childIndex+'" parent="'+parentNode.attr("classid")+'">';
			html += '<td class="text-center"><input name="rmid['+item["classid"]+']" type="checkbox" rel="del"  /></td>';
			html += '<td>'+pexyText+'<input name="order[]" type="text" id="order[]" class="textinput" tabindex="11" value="'+item["displayorder"]+'" size="4" />';
			html += '<input name="orderid[]" type="hidden" id="orderid[]" value="'+item["classid"]+'" /></td>';
			if(Number(item["sitenum"]) > 0){
				var classNameText = item["classname"];
				if(Number(item["sub_classnum"]) > 0){
					classNameText = '<a href="javascript://">' + classNameText + '</a>';
				}
				html += '<td rel="classname">' + pexyText + classNameText + ' <a rel="sites" href="?c=site_manage&classid='+item["classid"]+'" style="color:red;">[列表]</a></td>';
			}
			else{
				html += '<td rel="classname">' + pexyText + '<a href="javascript://">' + item["classname"]+'</a></td>';
			}
			
			html += '<td><input name="path['+item["classid"]+']" type="text" class="textinput" style="width: 200px;" id="path['+item["classid"]+']" value="'+item["path"]+'" /></td>';
			html += '<td>'+ (item["sitenum"] == 0? (item["sub_sitenum"] || 0 ) : item["sitenum"])+'</td>';
			html += '<td>[<a href="?c=class&a=edit&id='+item["classid"]+'&classid=&path='+item["path"]+'">修改</a>] &nbsp; [<a href="?c=class&a=edit&id='+item["classid"]+'&classid=&path='+item["path"]+'&mkhtml=1">生成 HTML</a>] </td>';
			html += '</tr>';
		}
		//alert(html);
		var col = $(html);
		col.find("td[rel='classname'] a").not("[rel='sites']").each(function(i){
			CatgoryManager._bindEvent($(this));
		});
		parentNode.after(col);
		return col;
	});
	CatgoryManager.Init($("#datatable"));
</script>
<div id="js_search_msg" class="js_search_msg" style="display:none;"></div>
<style type="text/css">
	.js_search_msg{ position:absolute; background:#fff; border:1px solid #CEDEAE;}
	.js_search_msg li{ padding:3px 5px; cursor:pointer;}
	.js_search_msg li.active{ background:#EBF4D8}
</style>
<script type="text/javascript" src="static/js/textboxdrop.js"></script>
<script type="text/javascript">
	$(document).ready(function(){
		$(".admin-tb").find("input[rel='del']").each(function(i){
			$(this).bind("click",function(){
				$(".admin-tb").find("input[rel='del']").each(function(i){
					var tr = $(this).parent().parent();
					if(this.checked){
						tr.addClass("checked");
					}
					else{
						tr.removeClass("checked");
					}
				})
				
			})
		});					   
		
		var t = new TextBoxDrop("tool_kw","js_search_msg");
		t.SetEnterHandler (function(ele){
							CatgoryManager.SelectClass($(ele).attr("rel"));
					});
		t.DefaultKey = "id_list";
		t.SetAjaxMethod($.get);
		t.Url('?c=class&a=search&k=');
		t.SetContentStyle(function(intput,contentbox){
			var inputBox = $(intput);
			if($.browser.ie){
				contentbox.style.left = inputBox.offset().left;
				contentbox.style.top = inputBox.offset().top + 23;
			}
			else{
				$(contentbox).css({
					top : inputBox.offset().top + 23,
					left: inputBox.offset().left
				});
			}
		});
		t.DisplayContentHandler(function(input,contentbox){						   
			if($(contentbox).width() < $(input).outerWidth()){
				$(contentbox).width($(input).outerWidth());
			}
		});
	});
</script>

<p style="text-align:center;padding:15px;color:#6B7355;
font-family:Verdana;
font-size:12px;">
Powered by <a href="http://www.ylmf.com" target="_blank"> <b>雨林木风</b></a> &copy; 2009 <a href="http://www.114la.com" target="_blank"> <b>114la.com</b></A><a href="http://www.ylmf.com" target="_blank"></a>
</p>
</body>
</html>

